package com.knowledge.review.designPatterns.creatormode.factorypattern.factorymethodpattern;

/**
 * @author XFW
 * @date 2024/5/6 13:59
 * @Description 具体工厂角色
 **/
public class FruitColorFactory extends FruitAbstractFactory{
 
    @Override
    public String getFruitColor(Fruit fruit) {
        return fruit.getColor();
    }
 
    @Override
    public String getFruitTaste(Fruit fruit) {
        return null;
    }
}
 
class FruitTasteFactory extends FruitAbstractFactory{
 
    @Override
    public String getFruitColor(Fruit fruit) {
        return null;
    }
 
    @Override
    public String getFruitTaste(Fruit fruit) {
        return fruit.getTaste();
    }
}